1. Field of the Invention
The present invention relates generally to a three-dimensional rendering processor for processing three-dimensional (3D) graphics, and more particularly, to a method and apparatus for processing pixel rasterization in a 3D rendering processor.
2. Background of the Related Art
Currently, a high-performance 3D rendering processor supports a texture mapping, bump mapping, and environment mapping in addition to an interpolation and depth test (or z test) which are the basic function of the processor.
Especially, the texture mapping is the most important barometer when the performance of the 3D rendering processor is measured, and the importance of the bump mapping and environment mapping has been recently highlighted.
Meanwhile, in order to support the texture mapping, a large amount of memory is required as well as a large-scaled hardware, and this is the most important factor in a memory bandwidth problem that is the biggest bottleneck to the design of the rendering processor.
The most important thing in the design of the rendering processor is how to process the texture mapping effectively.
A pixel rasterization processing section of a general 3D graphic rendering processor performs the depth test after performing the texture mapping.
This is called a pre-texturing method, and the biggest defect of this method is that the texture mapping is performed even with respect to the present image that is superimposed and is not shown due to the previously processed image.
Thus, the pre-texturing method should use an unnecessary memory bandwidth, and this causes the whole performance to deteriorate.
Generally, the 3D graphic image has a plurality of depth complexity, and in case that the depth complexity is 3, about 40% of images are thrown away during the depth test.
Here, the depth complexity represents the average number of fragment images corresponding to one pixel position, and the depth test is for determining the depth value of the present fragment image by comparing the depth value of the previously processed fragment image with that of the fragment image to be presently processed.
In this case, if the depth test is performed after the texture mapping, about 40% of the memory bandwidth required for the whole texture mapping is wasted, and the whole performance deteriorates with the greatly increased power consumption caused by the unnecessary performing of hardware.
In order to solve these problems, a post-texturing method has been proposed.
This method requires a wider fragment image queue in comparison to the pre-texturing method.
Here, the fragment image queue means a FIFO (first-in-first-out) queue for processing a pipeline of the pixel rasterization of the rendering processor.
Also, the post-texturing method includes many processing steps between depth reading operation and writing operation to process a transparent texture image.
Due to this, two or more pixels may share the same memory address between the depth reading operation and writing operation.
Accordingly, the post-texturing method may cause a consistency problem.
In order to detect such a consistency problem, an associative logic is required, but selection of this associative logic imposes a great burden on hardware.
Also, except the rendering processor having a built-in frame memory, most rendering processors use a pixel cache memory having depth information and color information.
However, the hit ratio of the pixel cache memory greatly deteriorates in comparison to that of the microprocessor.
Accordingly, the present invention is directed to a method and apparatus for processing pixel rasterization in a 3D rendering processor that substantially obviates one or more problems due to limitations and disadvantages of the related art.
An object of the present invention is to provide a method and apparatus for processing pixel rasterization in a 3D rendering processor that can remove the unnecessary performing of the texture mapping.
Another object of the present invention is to provide a method and apparatus for processing pixel rasterization in a 3D rendering processor that can simply and easily detect the consistency problem.
Still another object of the present invention is to provide a method and apparatus for processing pixel rasterization in a 3D rendering processor that can greatly reduce the stop of performing the pipeline.
Additional advantages, objects, and features of the invention will be set forth in part in the description which follows and in part will become apparent to those having ordinary skill in the art upon examination of the following or may be learned from practice of the invention. The objectives and other advantages of the invention may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
To achieve these objects and other advantages and in accordance with the purpose of the invention, as embodied and broadly described herein, a method of processing pixel rasterization in a 3D rendering processor includes the steps of receiving an input of present fragment image information from an outside, primarily checking existence/nonexistence of previous fragment image information corresponding to an address of the inputted present fragment image information, immediately texture-mapping the present fragment image information if the previous fragment image information does not exist as a result of the primary checking, while texture-mapping the present fragment image information after determining a depth value of the present fragment image information if the previous fragment image information exists, determining a transparency value of the texture-mapped present fragment image information, secondarily checking existence/nonexistence of the previous fragment image information corresponding to the address of the present fragment image information, determining the depth value of the present fragment image information if the previous fragment image information exists as a result of the secondary checking, storing the determined depth value of the present fragment image information, and determining and storing a color value of the present fragment image information.
Here, the method further includes the step of stopping the input of the present fragment image information and repeatedly checking whether the previous fragment image information corresponding to the address of the present fragment image information exists if the previous fragment image information does not exist as the result of the secondary checking.
Meanwhile, the step of primarily checking the existence/nonexistence of the previous fragment image information corresponding to the address of the present fragment image information includes the steps of checking whether the address of the present fragment image information coincides with the address of the previous fragment image information referring to a tag of the address of the present fragment image information by comparing the addresses, requesting the previous fragment image information corresponding to the address of the present fragment image information if the addresses do not coincide with each other, receiving the requested previous fragment image information, and reading the depth value of the received previous fragment image information.
Here, the primary checking step further includes the step of comparing the depth value of the previous fragment image information with that of the present fragment image information if the addresses coincide with each other.
Meanwhile, the step of secondarily checking the existence/nonexistence of the previous fragment image information corresponding to the address of the present fragment image information includes the steps of checking whether the address of the present fragment image information coincides with the address of the previous fragment image information referring to a tag of the address of the present fragment image information by comparing the addresses, requesting the previous fragment image information corresponding to the address of the present fragment image information if the addresses do not coincide with each other, but coincide with each other at the primary checking step, receiving the requested previous fragment image information, and reading the depth value of the received previous fragment image information.
Here, the secondary checking step further includes the step of comparing the depth value of the previous fragment image information with that of the present fragment image information irrespective of the address coincidence at the primary checking step if the addresses coincide with each other.
Also, the step of secondarily checking the existence/nonexistence of the previous fragment image information corresponding to the address of the present fragment image information includes the steps of checking whether the address of the present fragment image information coincides with the address of the previous fragment image information referring to a tag of the address of the present fragment image information by comparing the addresses, receiving the previous fragment image information previously requested at the primary checking if the addresses do not coincide with each other, and also do not coincide with each other at the primary checking step, and reading the depth value of the received previous fragment image information.
Here, the secondary checking step further includes the step of comparing the depth value of the previous fragment image information with that of the present fragment image information irrespective of the address coincidence at the primary checking step if the addresses coincide with each other.
In another aspect of the present invention, a method of processing pixel rasterization in a 3D rendering processor includes the steps of receiving an input of present fragment image information from an outside, primarily checking existence/nonexistence of previous fragment image information corresponding to an address of the inputted present fragment image information, immediately texture-mapping the present fragment image information if the previous fragment image information does not exist as a result of the primary checking, while checking whether the previous fragment image information corresponding to the address of the inputted present fragment image information is presently in use if the previous fragment image information exists, indicating and storing a used state in the flag of the previous fragment image information if the previous fragment image information is not in use as a result of checking, texture-mapping the present fragment image information after determining a depth value of the present fragment image information, determining a transparency value of the texture-mapped present fragment image information, checking whether the depth value of the texture-mapped present fragment image information is determined, secondarily checking existence/nonexistence of the previous fragment image information corresponding to the address of the present fragment image information if the depth value of the present fragment image information is not determined as a result of checking, determining the depth value of the present fragment image information if the previous fragment image information exists as a result of the secondary checking, storing the determined depth value of the present fragment image information and simultaneously updating the used state of the corresponding address of the previous fragment image information presently used, and determining and storing a color value of the present fragment image information.
Here, the method further includes the step of stopping performing of a next operation step and repeatedly checking whether the previous fragment image information is presently in use if the previous fragment image information is in use as a result of checking whether the previous fragment image information is presently in use.
Also, the method further includes the step of storing the depth value of the determined present fragment image information if the depth value of the present fragment image information is determined as a result of checking whether the depth value of the texture-mapped present fragment image information is determined.
Also, the method further includes the step of stopping the input of the present fragment image information and repeatedly checking whether the previous fragment image information corresponding to the address of the present fragment image information exists if the previous fragment image information does not exist as the result of the secondary checking.
In still another aspect of the present invention, an apparatus for processing pixel rasterization in a 3D rendering processor includes a memory section for storing fragment image information in which a certain depth value and color value are operated in corresponding addresses, a first depth operation section for reading out from the memory section the depth value of previous fragment image information corresponding to an address of present fragment information externally inputted and operating the depth value of the present fragment image information, a texture mapping section for texture-mapping the present fragment image information, a second depth operation section for reading out from the memory section the depth value of the previous fragment image information corresponding to the address of the present fragment image information inputted from the texture mapping section and operating the depth value of the present fragment image information, a transparency operation section for operating a transparency value of the texture-mapped present fragment image information, a flag memory section for storing a flag of the previous fragment image information presently used, checking whether the previous fragment image information corresponding to the address of the present fragment image information is presently in use through the flag, and updating the flag of the used previous fragment image information, and a color operation section for operating a color value of the present fragment image information.
Here, the memory section includes a texture cache memory, and pixel cache memory or frame buffer.
The flag memory section includes a flag section for storing the flag of the previous fragment image information presently used, a flag checking section for checking whether the previous fragment image information corresponding to the address of the present fragment image information is presently in use through the flag value, of the flag section, and a flag updating section for updating the flag value of the used previous fragment image information.
Also, the apparatus according to the present invention further includes a tag section for checking whether the address of the present fragment image information inputted from the first and second depth operation sections coincides with the address of the previous fragment image information referring to the tag of the present fragment image information address by comparing the addresses, and a request section for requesting the previous fragment image information corresponding to the address of the present fragment image information if the addresses do not coincide with each other.
According to the apparatus of the present invention as constructed above, the performing of the unnecessary texture mapping can be removed, and the consistency problem can be simply and easily detected. Also, the stop of performing the pipeline due to the nonexistence of the previous fragment image information in the pixel cache memory can be greatly reduced.
It is to be understood that both the foregoing general description and the following detailed description of the present invention are exemplary and explanatory and are intended to provide further explanation of the invention as claimed.